package cs561.hao;

import java.util.ArrayList;

class TreeNode {// the node in the game tree
	public boolean root = true;
	public boolean leaf = true;
	public String nodeName = "emptyNode";
	public int utility = -999999999;//utility = leaf node utility
	public TreeNode parent = null;
	public ArrayList<TreeNode> childrenList = new ArrayList<TreeNode>();
	public int alpha = Integer.MIN_VALUE;
	public int beta = Integer.MAX_VALUE;
	
	public PlayerInfo p1 = new PlayerInfo();
	public PlayerInfo p2 = new PlayerInfo();
	
	public boolean valid = true;//check whether the node is crash to off road or opponent.
	
	public void addChild(TreeNode child)
	{
		child.parent = this;
		child.root = false;
		child.leaf = true;
		childrenList.add(child);
		this.leaf = false;
	}
}
